package com.jack006.api.controller.article;

import com.jack006.grace.result.GraceJSONResult;
import com.jack006.pojo.bo.CommentReplyBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @Classname CommentControllerApi
 * @Description 评论相关业务
 * @Date 2021-07-05 20:49
 * @Created by jack
 */
@Api(value = "评论相关业务的 controller",tags = "评论相关业务的 controller")
@RequestMapping("comment")
public interface CommentControllerApi {


    @ApiOperation(value = "用户评论",notes = "查询作家文章",httpMethod = "POST")
    @PostMapping("createComment")
    GraceJSONResult createComment(@RequestBody @Valid CommentReplyBO commentReplyBO);

    @ApiOperation(value = "用户评论",notes = "查询作家文章",httpMethod = "GET")
    @GetMapping("counts")
    GraceJSONResult commentCounts(@RequestParam("articleId")String articleId);


    @ApiOperation(value = "查询评论列表",notes = "查询评论列表",httpMethod = "GET")
    @GetMapping("list")
    GraceJSONResult list(@RequestParam("articleId") String articleId,
                         @ApiParam(name = "page", value = "查询下一页的第几页", required = false)
                         @RequestParam("page") Integer page,
                         @ApiParam(name = "pageSize", value = "分页的每一页显示的条数", required = false)
                         @RequestParam("pageSize") Integer pageSize);

    @ApiOperation(value = "删除评论",notes = "删除评论",httpMethod = "POST")
    @PostMapping("delete")
    GraceJSONResult delete(@RequestParam("writerId")String writerId,
                           @RequestParam("commentId")String commentId);


    @ApiOperation(value = "查询评论管理列表",notes = "查询评论管理列表",httpMethod = "POST")
    @PostMapping("mng")
    GraceJSONResult mng(@RequestParam("writerId")String writerId,
                        @ApiParam(name = "page", value = "查询下一页的第几页", required = false)
                        @RequestParam("page") Integer page,
                        @ApiParam(name = "pageSize", value = "分页的每一页显示的条数", required = false)
                        @RequestParam("pageSize") Integer pageSize);


}


